home *** CD-ROM | disk | FTP | other *** search
- Path: news.unt.edu!news
- From: Steve Fogoros <sfogoros@hsc.unt.edu>
- Newsgroups: comp.lang.c
- Subject: Re: Programming Question
- Date: Sun, 03 Mar 1996 22:04:59 -0800
- Organization: University of North Texas Health Science Center
- Message-ID: <313A880B.1B49@hsc.unt.edu>
- References: <1996Mar3.164754.137341@forest>
- NNTP-Posting-Host: sfogoros.hsc.unt.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
-
- ebromber@forest.drew.edu wrote:
- >
- > Below is part of the code for a password program which I wrote. However,
- > wheneve I run the program, the "ENTER PASSWORD HERE" only appears after a
- > carriage return is entered. In other words, I have to type the password in
- > before it prints that message. If I hit return, it accepts that as the
- > password. I wrote this program on a pc and used a MS-DOS compiler. Does
- > anyone know why and how I can fix this?
- >
- > Thanks in advance.
- > ebromber@drew.edu
- >
- > PARTIAL CODE
- > int pass[100];
- > int count=0;
- > char ch;
- > printf("ENTER PASSWORD HERE: ");
- > while (ch=getch() !='\n')
- > { pass[count]=ch;
- > putch('*');
- > count++;
- > }
-
- I couldn't duplicate using Borland 3.1. You might try fflush(stdout) after printf("Enter ...).
-
- --
- Steve Fogoros, Academic Information Coordinator
- University of North Texas Health Science Center
- sfogoros@hsc.unt.edu
-